<?php
if(!empty($_COOKIE['Token'])){
    //echo '你的图片编号为：'.$_COOKIE['Token'];
   // echo '<br/>';
    echo '<a href="index.php">退出登录</a>';
}
//else{
//    echo '未登录，请登录';
//    echo '<br/>';
//    echo '<a href="index.php">重新登录</a>';
//    die;
//}
?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title></title>
</head>

<body>
<form action="user.php" method="post" enctype="multipart/form-data">
    请选择头像：
    <input type="file" name="file" multiple="multiple" onchange="showImg1()" />
    <br />
    <img src="" id="show" width="100px" height="100px" />
    <input type="submit" name="" id="" value="提交" />
</form>

</body>
<script type="text/javascript">
    var fileObj = document.getElementById('file');
    function showImg1() {
        var files = fileObj['files'];
        var URL = window.URL || window.webkitURL;
        var imgURL = URL.createObjectURL(files[0]);
        document.getElementById('show').src = imgURL;
    }
</script>

</html>
